﻿using System;

namespace PefStudio.Services
{
    public class LoggingService
    {
        public const string Contract = "PefStudio.Services.Logging";

        public static LoggingService Instance { get; set; }
        public ILoggingService ILoggingService { get; set; }

        static LoggingService()
        {
            Instance = new LoggingService();
        }

        public static void Debug(object message)
        {
            Instance.ILoggingService.Debug(message);
        }

        public static void DebugFormatted(string format, params object[] args)
        {
            Instance.ILoggingService.DebugFormatted(format, args);
        }

        public static void Info(object message)
        {
            Instance.ILoggingService.Info(message);
        }

        public static void InfoFormatted(string format, params object[] args)
        {
            Instance.ILoggingService.InfoFormatted(format, args);
        }

        public static void Warn(object message)
        {
            Instance.ILoggingService.Warn(message);
        }

        public static void Warn(object message, Exception exception)
        {
            Instance.ILoggingService.Warn(message, exception);
        }

        public static void WarnFormatted(string format, params object[] args)
        {
            Instance.ILoggingService.WarnFormatted(format, args);
        }

        public static void Error(object message)
        {
            Instance.ILoggingService.Error(message);
        }

        public static void Error(object message, Exception exception)
        {
            Instance.ILoggingService.Error(message, exception);
        }

        public static void ErrorFormatted(string format, params object[] args)
        {
            Instance.ILoggingService.ErrorFormatted(format, args);
        }

        public static void Fatal(object message)
        {
            Instance.ILoggingService.Fatal(message);
        }

        public static void Fatal(object message, Exception exception)
        {
            Instance.ILoggingService.Fatal(message, exception);
        }

        public static void FatalFormatted(string format, params object[] args)
        {
            Instance.ILoggingService.FatalFormatted(format, args);
        }

        public static bool IsDebugEnabled
        {
            get
            {
                return Instance.ILoggingService.IsDebugEnabled;
            }
        }

        public static bool IsInfoEnabled
        {
            get
            {
                return Instance.ILoggingService.IsInfoEnabled;
            }
        }

        public static bool IsWarnEnabled
        {
            get
            {
                return Instance.ILoggingService.IsWarnEnabled;
            }
        }

        public static bool IsErrorEnabled
        {
            get
            {
                return Instance.ILoggingService.IsErrorEnabled;
            }
        }

        public static bool IsFatalEnabled
        {
            get
            {
                return Instance.ILoggingService.IsFatalEnabled;
            }
        }
    }
}
